/**
 * Created by deng on 16-4-13.
 */

angular.module('metalabPartnerApp').factory('MetaUtils', [function () {
    var func = {};

    func.range = function (page, itemPerPage) {
        var temp = 0;
        try {
            var page = parseInt(page);
            var itemPerPage = parseInt(itemPerPage);
            temp = ((page - 1 ) * itemPerPage + 1) + '_' + (page * itemPerPage);
        } catch (error) {
            console.error(error);
        }
        return temp;
    };

    func.statistic = function () {
        (function () {
            //document.write(decodeURIComponent("%3Cspan id='cnzz_stat_icon_1259775237'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s95.cnzz.com/z_stat.php%3Fid%3D1259775237' type='text/javascript'%3E%3C/script%3E"));
            var hm = document.createElement("script");
            hm.src = decodeURIComponent("//s9.cnzz.com/z_stat.php%3Fid%3D1259776025");
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    };

    return func;
}]);
